<html>
<head><meta charset="utf-8"><title>backport #66394 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html">backport #66394</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="182689308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/backport%20%2366394/near/182689308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html#182689308">(Dec 05 2019 at 18:42)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> <a href="https://github.com/rust-lang/rust/issues/66394" target="_blank" title="https://github.com/rust-lang/rust/issues/66394">#66394</a> doesn't seem to backport cleanly onto beta, could you prepare a commit that merges that into beta appropriately (no need to post a PR, I can fetch directly from your repo if you just push up a branch or so)</p>



<a name="182689368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/backport%20%2366394/near/182689368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html#182689368">(Dec 05 2019 at 18:42)</a>:</h4>
<p>Specifically I'm seeing this conflict:</p>
<div class="codehilite"><pre><span></span><span class="gh">diff --cc src/librustc_mir/transform/const_prop.rs</span>
<span class="gh">index f411dfed064,979d109aa05..00000000000</span>
<span class="gd">--- a/src/librustc_mir/transform/const_prop.rs</span>
<span class="gi">+++ b/src/librustc_mir/transform/const_prop.rs</span>
<span class="gu">@@@ -22,9 -22,10 +22,9 @@@ use rustc::ty::subst::InternalSubsts</span>
  use rustc_data_structures::fx::FxHashMap;
  use rustc_index::vec::IndexVec;
  use rustc::ty::layout::{
<span class="gd">-     LayoutOf, TyLayout, LayoutError, HasTyCtxt, TargetDataLayout, HasDataLayout,</span>
<span class="gi">+     LayoutOf, TyLayout, LayoutError, HasTyCtxt, TargetDataLayout, HasDataLayout, Size,</span>
  };

 -use crate::rustc::ty::subst::Subst;
  use crate::interpret::{
      self, InterpCx, ScalarMaybeUndef, Immediate, OpTy,
      StackPopCleanup, LocalValue, LocalState, AllocId, Frame,
<span class="gu">@@@ -308,11 -310,23 +311,37 @@@ impl&lt;&#39;mir, &#39;tcx&gt; ConstPropagator&lt;&#39;mir,</span>
          let mut ecx = InterpCx::new(tcx.at(span), param_env, ConstPropMachine, ());
          let can_const_prop = CanConstProp::check(body);

<span class="gi">++&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD</span>
<span class="gi">++||||||| parent of d389f64cdb5... Fix spurious CI filures due to OOM</span>
<span class="gi">++        let substs = &amp;InternalSubsts::identity_for_item(tcx, def_id);</span>
<span class="gi">++</span>
<span class="gi">++        let ret =</span>
<span class="gi">++            ecx</span>
<span class="gi">++                .layout_of(body.return_ty().subst(tcx, substs))</span>
<span class="gi">++                .ok()</span>
<span class="gi">++                // Don&#39;t bother allocating memory for ZST types which have no values.</span>
<span class="gi">++                .filter(|ret_layout| !ret_layout.is_zst())</span>
<span class="gi">++                .map(|ret_layout| ecx.allocate(ret_layout, MemoryKind::Stack));</span>
<span class="gi">++</span>
<span class="gi">++=======</span>
<span class="gi">+         let substs = &amp;InternalSubsts::identity_for_item(tcx, def_id);</span>
<span class="gi">+</span>
<span class="gi">+         let ret =</span>
<span class="gi">+             ecx</span>
<span class="gi">+                 .layout_of(body.return_ty().subst(tcx, substs))</span>
<span class="gi">+                 .ok()</span>
<span class="gi">+                 // Don&#39;t bother allocating memory for ZST types which have no values</span>
<span class="gi">+                 // or for large values.</span>
<span class="gi">+                 .filter(|ret_layout| !ret_layout.is_zst() &amp;&amp;</span>
<span class="gi">+                                      ret_layout.size &lt; Size::from_bytes(MAX_ALLOC_LIMIT))</span>
<span class="gi">+                 .map(|ret_layout| ecx.allocate(ret_layout, MemoryKind::Stack));</span>
<span class="gi">+</span>
<span class="gi">++&gt;&gt;&gt;&gt;&gt;&gt;&gt; d389f64cdb5... Fix spurious CI filures due to OOM</span>
          ecx.push_stack_frame(
 -            Instance::new(def_id, substs),
 +            Instance::new(def_id, &amp;InternalSubsts::identity_for_item(tcx, def_id)),
              span,
              dummy_body,
 -            ret.map(Into::into),
 +            None,
              StackPopCleanup::None {
                  cleanup: false,
              },
</pre></div>



<a name="182689409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/backport%20%2366394/near/182689409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html#182689409">(Dec 05 2019 at 18:43)</a>:</h4>
<p>when cherry picking <a href="https://github.com/rust-lang/rust/commit/d389f64cdb5b4a99075030131378b52ee791d8be" target="_blank" title="https://github.com/rust-lang/rust/commit/d389f64cdb5b4a99075030131378b52ee791d8be">d389f64cdb5b4a99075030131378b52ee791d8be</a></p>



<a name="182689426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/backport%20%2366394/near/182689426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html#182689426">(Dec 05 2019 at 18:43)</a>:</h4>
<p>Sure! I'll try to do that tonight.</p>



<a name="182689815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/backport%20%2366394/near/182689815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html#182689815">(Dec 05 2019 at 18:46)</a>:</h4>
<p>Thanks! Please ping me here once that's done so I can get the backport PR rolling</p>



<a name="182717780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/backport%20%2366394/near/182717780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html#182717780">(Dec 06 2019 at 00:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> The backport for <a href="https://github.com/rust-lang/rust/issues/66394" target="_blank" title="https://github.com/rust-lang/rust/issues/66394">#66394</a> is in <a href="https://github.com/rust-lang/rust/commit/ea9878be3f89052388aaa2c3ef6f1933ab99f1a5" target="_blank" title="https://github.com/rust-lang/rust/commit/ea9878be3f89052388aaa2c3ef6f1933ab99f1a5">https://github.com/rust-lang/rust/commit/ea9878be3f89052388aaa2c3ef6f1933ab99f1a5</a></p>



<a name="182717835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/backport%20%2366394/near/182717835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html#182717835">(Dec 06 2019 at 00:12)</a>:</h4>
<p>Thanks! I'm away from a keyboard right now but will merge that in tonight.</p>



<a name="182717851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/backport%20%2366394/near/182717851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html#182717851">(Dec 06 2019 at 00:12)</a>:</h4>
<p>Cool! LMK if you run into any issues</p>



<a name="182717872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/backport%20%2366394/near/182717872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html#182717872">(Dec 06 2019 at 00:12)</a>:</h4>
<p>That squashed everything into one commit, right?</p>



<a name="182717883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/backport%20%2366394/near/182717883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html#182717883">(Dec 06 2019 at 00:13)</a>:</h4>
<p>Yeah</p>



<a name="182717894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/backport%20%2366394/near/182717894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/backport.20.2366394.html#182717894">(Dec 06 2019 at 00:13)</a>:</h4>
<p>Perfect, thanks!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>